package com.example.boot01.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BMIController {
    @RequestMapping("/bmi")
    @ResponseBody


    public String bmi(double tall, double weight) {
        double result = weight / tall / tall;
        if (result < 18.4) {
            return "消瘦";
        }
        if (result < 23.9) {
            return "正常";
        }
        return "超重";
    }
}
